package com.xq.utils;

/**
 * stringBuffer 工具类
 *
 * @author xu
 * 2021/9/1 10:13
 */
public class StringBuffUtil {

    /**
     * 在字符串中插入字符
     * @param n 位置
     * @param str 字符串
     * @param insertStr 要插入的字符
     * @return 返回新字符串
     */
    public static String insert(int n,String str,String insertStr){
        StringBuffer stringBuffer = new StringBuffer(str);
        stringBuffer.insert(n,insertStr);
        return stringBuffer.toString();
    }

    public static void main(String[] args) {
        System.out.println(insert(2,"266565","."));
    }
}
